package com.googlecode.placesapiclient.client.entity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 */
public class PlacePrediction {


    public PlacePrediction() {
        termsMap = new HashMap<String, Integer>();
        typeList = new ArrayList<String>();
        matchedSubstringList = new ArrayList<MatchedSubstring>();
    }

    /**
     * Contains the human-readable name for the returned result. For establishment results, this is usually the business name.
     */
    protected String description;
    /**
     * Contains a unique token that you can use to retrieve additional information about this place in a Place Details request.
     * You can store this token and use it at any time in future to refresh cached data about this Place, but the same token
     * is not guaranteed to be returned for any given Place across different searches.
     */
    protected String reference;
    /**
     *id contains a unique stable identifier denoting this place. This identifier may not be used to retrieve information about this place,
     * but can be used to consolidate data about this Place, and to verify the identity of a Place across separate searches.
     */
    protected String id;
    /**
     * Contains an map of terms identifying each section of the returned description (a section of the description is generally terminated with a comma).
     * Each entry in the map has a key field, containing the text of the term, and an offset (value) field, defining the start position of this term in the description, measured in Unicode characters.
     */
    protected Map<String, Integer> termsMap;
    /**
     * The returned types of Place.
     */
    protected List<String> typeList;
    /**
     * These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired.
     */
    protected List<MatchedSubstring> matchedSubstringList;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Map<String, Integer> getTermsMap() {
        return termsMap;
    }

    public List<String> getTypeList() {
        return typeList;
    }

    public List<MatchedSubstring> getMatchedSubstringList() {
        return matchedSubstringList;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("PlacePrediction{");
        sb.append("description='").append(description).append('\'');
        sb.append(", reference='").append(reference).append('\'');
        sb.append(", id='").append(id).append('\'');
        sb.append(", termsMap=").append(termsMap);
        sb.append(", typeList=").append(typeList);
        sb.append(", matchedSubstringList=").append(matchedSubstringList);
        sb.append('}');
        return sb.toString();
    }
}
